#pragma once

#include <iostream>
#include <memory>

class Testpaper {
protected:
  std::string name_{};
public:
  Testpaper();
  ~Testpaper();
  void testQuestion1();
  void testQuestion2();
  void testQuestion3();
private:
  virtual std::string answer1() {return "a";};
  virtual std::string answer2() {return "a";};
  virtual std::string answer3() {return "a";};
};

using TestpaperPtr = std::shared_ptr<Testpaper>;

Testpaper::Testpaper() {
  std::cout << __func__ << ", Testpaper" << std::endl;
}

Testpaper::~Testpaper()
{
  std::cout << __func__ << ", ~Testpaper" << std::endl;
}

void Testpaper::testQuestion1() {
  std::cout << "天上有几个太阳：(a) 1个;(b)2个;(c)3个;(d)4个" << std::endl;
  std::cout << name_ << "的答案是：" << answer1() << std::endl;
}

void Testpaper::testQuestion2() {
  std::cout << "天上有几个月亮：(a) 1个;(b)2个;(c)3个;(d)4个" << std::endl;
  std::cout << name_ << "的答案是："  << answer2() << std::endl;
}

void Testpaper::testQuestion3() {
  std::cout << "天上有几个星星：(a) 1个;(b)2个;(c)3个;(d)X个" << std::endl;
  std::cout << name_ << "的答案是："  << answer3() << std::endl;
}
